<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>在线留言</title>
<%@include file="../../common/tagInclude.jsp" %>
<%@include file="../../common/headerInclude.jsp" %>
<script type="text/javascript">
	$(function() {
		$("#jvForm").validate();
	});
	function show(gbId){
		window.location = '${basePath}super/sysSetUp/gb-show.do?gbId='+gbId;
	}
	function del(gbId){
		if(!confirm("确定要删除此留言?")){
			return ;
		}
		window.location = '${basePath}super/sysSetUp/gb-del.do?gbId='+gbId;
	}
	function delSel(itemName){
		var all_checkbox = document.getElementsByName(itemName);
		var len = all_checkbox.length;
		if(isChecked(itemName) == false ){
			alert('至少选择一项');
		}else{
			if(!confirm('确认要删除指定内容?'))return;
			var values = "";
			for(var i=0;i<len ;i++){
				if(all_checkbox[i].checked)
					values += "," + all_checkbox[i].value;
			}
			if(values.length > 1)
				values = values.substring(1);
			window.location = '${basePath}super/sysSetUp/gb-del.do?gbId='+values;
		}
	}
	function setIndex(itemName,flag){
		var all_checkbox = document.getElementsByName(itemName);
		var len = all_checkbox.length;
		if(isChecked(itemName) == false ){
			alert('至少选择一项');
		}else{
			if(!confirm('确认要操作指定内容?'))return;
			var values = "";
			for(var i=0;i<len ;i++){
				if(all_checkbox[i].checked)
					values += "," + all_checkbox[i].value;
			}
			if(values.length > 1)
				values = values.substring(1);
			window.location = '${basePath}super/sysSetUp/gb-setIndex.do?flag='+flag+'&gbId='+values;
		}
	}
</script>
</head>
<body>
<div class="body-box">
	<div class="rhead">
		<div class="rpos">当前位置: 首页  - 系统 - 在线留言管理 </div>
		<div class="clear"></div>
	</div>
	<form action="${basePath}super/sysSetUp/gb-list.do" method="get" style="padding-top:5px;">
		<div>
			<!-- 语种&nbsp;<select name="languageId" id="languageId">
					<option value="">请选择</option>
					<option value="1">中文</option>
					<option value="2">英文</option>
				</select>-->
			是否显示&nbsp;<select name="isShow" id="isShow">
					<option value="">请选择</option>
					<option value="0" <c:if test="${isShow == 0}">selected</c:if> >否</option>
					<option value="1" <c:if test="${isShow == 1}">selected</c:if> >是</option>
				</select>&nbsp;&nbsp;
			是否回复&nbsp;<select name="isComment" id="isComment">
					<option value="">请选择</option>
					<option value="0" <c:if test="${isComment == 0}">selected</c:if> >否</option>
					<option value="1" <c:if test="${isComment == 1}">selected</c:if> >是</option>
				</select>&nbsp;&nbsp;
			&nbsp;&nbsp;<input type="submit" value="查询"><br/><br/>
			<a href="javascript:checkAll('gbId',true);">全选</a>&nbsp;&nbsp;<a href="javascript:checkAll('gbId',false);">取消</a>&nbsp;&nbsp;
			<a href="javascript:delSel('gbId');">删除所选</a>&nbsp;&nbsp;
			<a href="javascript:setIndex('gbId','1');">设置显示</a>&nbsp;&nbsp;
			<a href="javascript:setIndex('gbId','0');">取消显示</a>&nbsp;&nbsp;
		</div>
		<table class="pn-ltable" width="100%" cellspacing="1" cellpadding="0" border="0">
			<thead class="pn-lthead">
			<tr>
				<th width="5%">序列</th>
				<th width="5%">语种</th>
				<th width="20%">姓名</th>
				<th width="20%">邮箱</th>
				<th width="20%">时间</th>
				<th width="10%">是否显示</th>
				<th width="10%">是否回复</th>
				<th width="10%">操作</th>
			</tr>
			</thead>
			<tbody class="pn-ltbody">
			<c:forEach items="${gbList}" var="gb" varStatus="status">
			<tr>
				<td align="center"><input type="checkbox" id="gbId" name="gbId" value="${gb.gbId}"/></td>
				<td align="center">${gb.languageInfo.name}</td>
				<td align="center">${gb.gbUsername}</td>
				<td align="center">${gb.gbEmail}</td>
				<td align="center">${gb.gbTime}</td>
				<td align="center"><c:if test="${gb.isShow == 0}">否</c:if><c:if test="${gb.isShow == 1}">是</c:if></td>
				<td align="center"><c:if test="${gb.commentUser == 0}">否</c:if><c:if test="${gb.commentUser > 0}">是</c:if></td>
				<td align=center>
					<a href="javascript:show('${gb.gbId}');">查看</a>&nbsp;&nbsp;
					<a href="javascript:del('${gb.gbId}');">删除</a>&nbsp;&nbsp;
				</td>
			</tr>
			</c:forEach>
			</tbody>
		</table>
		<c:set var="pageURL" value="${basePath}super/sysSetUp/gb-list.do?languageId=${query.languageId}&isShow=${isShow}&isComment=${isComment}&"/>
		<%@include file="../../common/pages.jsp"%>
	</form>
</div>
</body>
</html>